#include <stdio.h>
#include <string.h>

int n, m, c;
unsigned int ans;

bool init()
{
    scanf("%d%d%d", &n, &m, &c);
    if (n==0 && m==0 && c==0) return false;
    return true;
}    

int getnum(int d)
{
    if (d<8) return 0;
    else 
    {
        return 1+(d-8)/2;
    }    
}    

unsigned int count(int x, int y)
{
    unsigned int a, b;
    a = getnum(x);
    b = getnum(y);
    return a*b;
}    

void deal()
{
    int i, state, j;
    ans = 0;
    
    state = (c==1)? 0 : 1;
    for (i=m; i>=8; --i)
    {
        j = n-state;
        state = state ^ 1;
        ans += getnum(j);
    }         
}    

int main()
{
    while (init())
    {
        deal();
        printf("%d\n", ans);
    }    
    
    return 0;
}    

